/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 流程图样式 */
#flowchart {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

/* 节点样式 */
.node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node:hover {
    transform: scale(1.05);
}

.node rect {
    fill: #fff;
    stroke: #374151;
    stroke-width: 2px;
    rx: 5;
    ry: 5;
}

.node.root rect {
    fill: #1f2937;
    stroke: #111827;
}

.node.driver rect {
    fill: #3b82f6;
    stroke: #2563eb;
}

.node.subtype rect {
    fill: #10b981;
    stroke: #059669;
}

.node text {
    font-size: 12px;
    fill: #fff;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.node.root text,
.node.driver text,
.node.subtype text {
    fill: #fff;
    font-weight: 500;
}

/* 连接线样式 */
.link {
    fill: none;
    stroke: #9ca3af;
    stroke-width: 2px;
    marker-end: url(#arrowhead);
}

.link:hover {
    stroke: #374151;
    stroke-width: 3px;
}

/* 详情卡片样式 */
.detail-card {
    max-height: 400px;
    overflow-y: auto;
}

.detail-card h4 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.detail-card ul {
    list-style-type: disc;
    margin-left: 1.5rem;
}

.detail-card li {
    color: #4b5563;
    margin-bottom: 0.25rem;
}

/* 指标样式 */
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
}

.metric-item {
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
}

.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .lg\\:col-span-3 {
        grid-column: span 1;
    }
    
    .lg\\:col-span-1 {
        grid-column: span 1;
    }
    
    #flowchart {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #flowchart {
        height: 50vh;
    }
    
    .node text {
        font-size: 10px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模拟结果样式 */
.simulation-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.simulation-result h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.simulation-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}
